import cv2
import time
import numpy as np

img = cv2.imread("a.jpg")
# cv2.imshow("image",img)

img[100:200,100:200] = (255,255,0)
# e1 = cv2.getTickCount()
# b,g,r = cv2.split(img)
# e2 = cv2.getTickCount()
# time = (e2 -e1)/cv2.getTickFrequency()

e1 = time.time()
b,g,r = cv2.split(img)
e2 = time.time()
time1 = (e2 -e1)


print "Time :",time1

haha = img[100:300,200:400]
img[300:500,600:800] = haha

cv2.imwrite("b.jpg",img)
cv2.imshow("b.jpg",img)


cv2.imshow("b",b)
cv2.imshow("g",g)
cv2.imshow("r",r)

print "img.shape:",img.shape
print "img.dtype:",img.dtype
print "img.size :",img.size

print "b.shape:",b.shape
print "b.dtype:",b.dtype
print "b.size :",b.size

hist = cv2.calcHist([img],[0],None,[256],[0,0,255,0])
					

cv2.waitKey(0)